export default [
  // user
  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      { path: '/user', redirect: '/user/login' },
      { path: '/user/login', name: 'login', component: './User/Login' },
      { path: '/user/register', name: 'register', component: './User/Register' },
      {
        path: '/user/register-result',
        name: 'register.result',
        component: './User/RegisterResult',
      },
      {
        component: '404',
      },
    ],
  },
  // app
  {
    path: '/',
    component: '../layouts/BasicLayout',
    Routes: ['src/pages/Authorized'],
    routes: [
      // dashboard
      { path: '/', redirect: '/dashboard/analysis', authority: ['admin', 'user'] },
      {
        path: '/dashboard',
        name: 'dashboard',
        icon: 'dashboard',
        routes: [
          {
            path: '/dashboard/analysis',
            name: 'analysis',
            component: './Dashboard/Analysis',
          },
          {
            path: '/dashboard/workplace',
            name: 'workplace',
            component: './Dashboard/Workplace',
          },
        ],
      },

      // 流程管理
      {
        name: 'procedure',
        icon: 'gateway',
        path: '/procedure',
        routes: [
          {
            name: 'create',
            path: '/procedure/create',
            component: './Procedure/ProcedureCreate',
            routes: [
              {
                path: '/procedure/create',
                redirect: '/procedure/create/all',
              },
              {
                name: 'all',
                path: '/procedure/create/all',
                hideInMenu: true,
                component: './Procedure/ProcedureCreateAll',
              },
              {
                name: 'storage',
                path: '/procedure/create/storage',

                hideInMenu: true,
                component: './Procedure/ProcedureCreateStorage',
              },
            ],
          },
          {
            name: 'todo',
            path: '/procedure/todo',
            component: './Procedure/ProcedureTodo',
          },
          {
            name: 'completed',
            path: '/procedure/completed',
            component: './Procedure/ProcedureCompleted',
          },
          {
            name: 'proxy',
            path: '/procedure/proxy',
            component: './Procedure/ProcedureProxy',
          },
          // TODO: 智能审批不想做了
          // {
          //   name: 'intelligenceApproval',
          //   path: '/procedure/approval',
          //   component: './Procedure/IntelligentApproval',
          // },
        ],
      },
      // 教师管理
      {
        name: 'teachers',
        icon: 'team',
        path: '/teachers',
        routes: [
          {
            name: 'list',
            path: '/teachers/list',
            component: './Teachers/TeacherList',
          },
          {
            path: '/teachers/create',
            name: 'create',
            component: './Teachers/TeacherCreate',
          },
          {
            path: '/teachers/:id',
            name: 'detail',
            hideInMenu: true,
            component: './Teachers/TeacherDetail',
          },
        ],
      },

      // 学生管理
      {
        name: 'students',
        icon: 'coffee',
        path: '/students',
        routes: [
          {
            name: 'list',
            path: '/students/list',
            component: './Students/StudentList',
          },
          {
            name: 'create',
            path: '/students/create',
            component: './Students/StudentCreate',
          },
          {
            name: 'detail',
            path: '/students/:key',
            hideInMenu: true,
            component: './Students/StudentDetail',
          },
        ],
      },

      // 课程管理
      {
        icon: 'solution',
        path: '/subject',
        name: 'subject',
        component: './Subject/SubjectList',
      },
      // 考试管理
      // {
      //   icon: 'credit-card',
      //   path: '/exam',
      //   name: 'exam',
      //   component: './Exam/ExamList',
      // },
      // 考勤管理
      {
        name: 'attendance',
        icon: 'dot-chart',
        path: '/attendance',
        routes: [
          {
            name: 'all',
            path: '/attendance/all',
            component: './Attendance/AttendanceList',
          },
          {
            name: 'my',
            path: '/attendance/my',
            component: './Attendance/AttendanceMine',
          },
        ],
      },

      // 机构设置
      // TODO: 不想做了
      // {
      //   icon: 'cluster',
      //   path: '/institutional',
      //   name: 'institutional',
      //   component: './Institutional',
      // },

      {
        name: 'account',
        icon: 'user',
        path: '/account',
        routes: [
          {
            path: '/account/center',
            name: 'center',
            component: './Account/Center/Center',
            routes: [
              {
                path: '/account/center',
                redirect: '/account/center/articles',
              },
              {
                path: '/account/center/articles',
                component: './Account/Center/Articles',
              },
              {
                path: '/account/center/applications',
                component: './Account/Center/Applications',
              },
              {
                path: '/account/center/projects',
                component: './Account/Center/Projects',
              },
            ],
          },
          {
            path: '/account/settings',
            name: 'settings',
            component: './Account/Settings/Info',
            routes: [
              {
                path: '/account/settings',
                redirect: '/account/settings/base',
              },
              {
                path: '/account/settings/base',
                component: './Account/Settings/BaseView',
              },
              {
                path: '/account/settings/security',
                component: './Account/Settings/SecurityView',
              },
              {
                path: '/account/settings/binding',
                component: './Account/Settings/BindingView',
              },
              {
                path: '/account/settings/notification',
                component: './Account/Settings/NotificationView',
              },
            ],
          },
        ],
      },

      // 机构设置
      // TODO: 不想做了
      {
        icon: 'cluster',
        path: '/echarts',
        name: 'institutional',
        component: './Institutional',
      },

      /**
       * ---------------------------
       */
      // forms
      // {
      //   path: '/form',
      //   icon: 'form',
      //   name: 'form',
      //   routes: [
      //     {
      //       path: '/form/basic-form',
      //       name: 'basicform',
      //       component: './Forms/BasicForm',
      //     },
      //     {
      //       path: '/form/step-form',
      //       name: 'stepform',
      //       component: './Forms/StepForm',
      //       hideChildrenInMenu: true,
      //       routes: [
      //         {
      //           path: '/form/step-form',
      //           redirect: '/form/step-form/info',
      //         },
      //         {
      //           path: '/form/step-form/info',
      //           name: 'info',
      //           component: './Forms/StepForm/Step1',
      //         },
      //         {
      //           path: '/form/step-form/confirm',
      //           name: 'confirm',
      //           component: './Forms/StepForm/Step2',
      //         },
      //         {
      //           path: '/form/step-form/result',
      //           name: 'result',
      //           component: './Forms/StepForm/Step3',
      //         },
      //       ],
      //     },
      //     {
      //       path: '/form/advanced-form',
      //       name: 'advancedform',
      //       authority: ['admin'],
      //       component: './Forms/AdvancedForm',
      //     },
      //   ],
      // },
      // // list
      // {
      //   path: '/list',
      //   icon: 'table',
      //   name: 'list',
      //   routes: [
      //     {
      //       path: '/list/table-list',
      //       name: 'searchtable',
      //       component: './List/TableList',
      //     },
      //     {
      //       path: '/list/basic-list',
      //       name: 'basiclist',
      //       component: './List/BasicList',
      //     },
      //     {
      //       path: '/list/card-list',
      //       name: 'cardlist',
      //       component: './List/CardList',
      //     },
      //     {
      //       path: '/list/search',
      //       name: 'searchlist',
      //       component: './List/List',
      //       routes: [
      //         {
      //           path: '/list/search',
      //           redirect: '/list/search/articles',
      //         },
      //         {
      //           path: '/list/search/articles',
      //           name: 'articles',
      //           component: './List/Articles',
      //         },
      //         {
      //           path: '/list/search/projects',
      //           name: 'projects',
      //           component: './List/Projects',
      //         },
      //         {
      //           path: '/list/search/applications',
      //           name: 'applications',
      //           component: './List/Applications',
      //         },
      //       ],
      //     },
      //   ],
      // },
      // {
      //   path: '/profile',
      //   name: 'profile',
      //   icon: 'profile',
      //   routes: [
      //     // profile
      //     {
      //       path: '/profile/basic',
      //       name: 'basic',
      //       component: './Profile/BasicProfile',
      //     },
      //     {
      //       path: '/profile/basic/:id',
      //       name: 'basic',
      //       hideInMenu: true,
      //       component: './Profile/BasicProfile',
      //     },
      //     {
      //       path: '/profile/advanced',
      //       name: 'advanced',
      //       authority: ['admin'],
      //       component: './Profile/AdvancedProfile',
      //     },
      //   ],
      // },
      // {
      //   name: 'result',
      //   icon: 'check-circle-o',
      //   path: '/result',
      //   routes: [
      //     // result
      //     {
      //       path: '/result/success',
      //       name: 'success',
      //       component: './Result/Success',
      //     },
      //     { path: '/result/fail', name: 'fail', component: './Result/Error' },
      //   ],
      // },
      // {
      //   name: 'exception',
      //   icon: 'warning',
      //   path: '/exception',
      //   routes: [
      //     // exception
      //     {
      //       path: '/exception/403',
      //       name: 'not-permission',
      //       component: './Exception/403',
      //     },
      //     {
      //       path: '/exception/404',
      //       name: 'not-find',
      //       component: './Exception/404',
      //     },
      //     {
      //       path: '/exception/500',
      //       name: 'server-error',
      //       component: './Exception/500',
      //     },
      //     {
      //       path: '/exception/trigger',
      //       name: 'trigger',
      //       hideInMenu: true,
      //       component: './Exception/TriggerException',
      //     },
      //   ],
      // },
      // //  editor
      // {
      //   name: 'editor',
      //   icon: 'highlight',
      //   path: '/editor',
      //   routes: [
      //     {
      //       path: '/editor/flow',
      //       name: 'flow',
      //       component: './Editor/GGEditor/Flow',
      //     },
      //     {
      //       path: '/editor/mind',
      //       name: 'mind',
      //       component: './Editor/GGEditor/Mind',
      //     },
      //     {
      //       path: '/editor/koni',
      //       name: 'koni',
      //       component: './Editor/GGEditor/Koni',
      //     },
      //   ],
      // },

      {
        component: '404',
      },
    ],
  },
];
